﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Factor;

public class FactorMain : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {
        //RunNormal();
        // RunSampleFactor();
        //RunFactor();
        RunAbstructFactor();
    }
    void RunNormal()
    {
        //DellMouse dellMouse = new DellMouse();
        //dellMouse.Print();
        new DellMouse().Print();
        HpMouse hpMouse = new HpMouse();
        hpMouse.Print();
    }
    void RunSampleFactor()//简单工厂模式  一个中间件
    {
        SampleFactor factor = new SampleFactor();
       AbstructMouse dellMouse= factor.CreatMouse(MouseType.DellMouse);
        dellMouse.Print();

        AbstructMouse hpMouse = factor.CreatMouse(MouseType.HpMouse);
        hpMouse.Print();
    }
    void RunFactor()//工厂模式   多个中间件
    {
        DellFactor dellFactor = new DellFactor();
        AbstructMouse dellMouse = dellFactor.CreatMouse();
        dellMouse.Print();
       

        HpFactor hpFactor = new HpFactor();
        AbstructMouse hpMouse = hpFactor.CreatMouse();
        hpMouse.Print();

        AppleFactor appleFactor = new AppleFactor();
        AbstructMouse appleMouse = appleFactor.CreatMouse();
        appleMouse.Print();
    }
    void RunAbstructFactor()
    {
        AbstructFactor_Apple abstructFactor_Apple = new AbstructFactor_Apple();
        AbstructMouse abstructMouse= abstructFactor_Apple.CreateMouse();
        abstructMouse.Print();
        AbstructKeyBoard abstructKeyBoard = abstructFactor_Apple.CreatekeyBoard();
        abstructKeyBoard.Print();

    }
    // Update is called once per frame
    void Update()
    {
        
    }
}
